import {req_delete, req_get, req_post, req_put} from "@/request/cssdrequest";
import {R} from "@/type/dto/R";
import {ScheduleTypeVO} from "@/type/vo/ScheduleTypeVO";
import {ScheduleShiftVO} from "@/type/vo/ScheduleShiftVO";

export async function api_listScheduleShift(id: string) {
    const data = await req_get('/schedule/shift', {
        id
    });
    //转成我要的json
    console.log('data:', data);
    return JSON.parse(data) as R<Array<ScheduleShiftVO>>;
}

export async function api_addScheduleShift(scheduleShift: ScheduleShiftVO
) {

    const data = await req_post('/schedule/shift', scheduleShift);
    //转成我要的json
    console.log('data:', data);
    return JSON.parse(data) as R<string>;
}

export async function api_updateScheduleShift(schedule: ScheduleShiftVO
) {

    const data = await req_put('/schedule/shift', schedule);
    //转成我要的json
    console.log('data:', data);
    return JSON.parse(data) as R<string>;
}


export async function api_deleteScheduleShift(deleteId: string) {

    const data = await req_delete('/schedule/shift', {
        id: deleteId
    });
    //转成我要的json
    console.log('data:', data);
    return JSON.parse(data) as R<object>;
}
